﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;

public class Order
{
    public int Id { get; set; }
}

public class OrderService
{
    private List<Order> orders = new List<Order>();

    public void AddOrder(Order order)
    {
        orders.Add(order);
    }

    public int GetOrdersCount()
    {
        return orders.Count;
    }

    public List<Order> GetAllOrders()
    {
        return orders;
    }

    public void Export(string filePath)
    {
        XmlSerializer serializer = new XmlSerializer(typeof(List<Order>));
        using (StreamWriter writer = new StreamWriter(filePath))
        {
            serializer.Serialize(writer, orders);
        }
    }

    public void Import(string filePath)
    {
        XmlSerializer serializer = new XmlSerializer(typeof(List<Order>));
        using (StreamReader reader = new StreamReader(filePath))
        {
            orders = (List<Order>)serializer.Deserialize(reader);
        }
    }
}